package net.sky.oa.test.dao.system;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import net.sky.oa.dao.system.SysPostDao;
import net.sky.oa.model.SysPost;
import net.sky.oa.test.BaseTestCase;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;

public class SysPostDaoTestCase extends BaseTestCase {

	@Resource
	private SysPostDao sysPostDao;

	@Test
	@Rollback(false)
	public void add() {
		SysPost sysPost = new SysPost();
		sysPost.setName("TestPostName1");
		sysPost.setCreatetime(new Date());
		sysPost.setFunction("PostFunction");
		this.sysPostDao.save(sysPost);
	}

	@Test
	@Rollback(false)
	public void find() {

		List<SysPost> posts = this.sysPostDao.findAllPost();
		for (SysPost post : posts) {
			System.out.println("getName:" + post.getName());
		}
	}
}